package com.zzw.thread;

public class MyThread extends Thread {

	public MyThread(String name){
		super(name);
	}
	
	public MyThread(ThreadGroup group,String name){
		super(group,name);
	}
	
	@Override
	public void run(){
		for(int i = 0;i < 20;i++){
			System.out.println(getName() + "" + i);
		}
	}
	
	public static void main(String[] args) {
		ThreadGroup group = Thread.currentThread().getThreadGroup();
		System.out.println("" + group.getName());
		System.out.println("" + group.isDaemon());
		new MyThread("").start();
		ThreadGroup threadGroup = new ThreadGroup("");
		threadGroup.setDaemon(true);
		System.out.println("" + threadGroup.isDaemon());
		MyThread tt = new MyThread(threadGroup, "");
		tt.start();
		new MyThread(threadGroup, "").start();
	}
}